﻿//==============================================================================  
//Copyright (C) 2012-2015 9UN.ORG. All rights reserved. 
//GUID：46172595-6b69-4526-b9da-426d663f5b05
//CLR Version: 4.0.30319.18033
//Code Author：Kevin Wang
//Contact：Email(Admin@9un.org),QQ(265382 or 74344)
//Filename：MediaLibraryFactory
//Namespace：RuanRang.Media.Core
//Functions：MediaLibraryFactory  
//Created by Kevin Wang at 2013/2/2 23:05:09 http://blog.9un.org
//============================================================================== 

#region Usings

using System;
using System.Runtime.InteropServices;

#endregion

namespace RuanRang.Media.Core.Internal.DataStructures
{
    /// <summary>
    /// Struct vlc_common_members
    /// </summary>
    [StructLayout(LayoutKind.Sequential)]
    public struct vlc_common_members
    {
        /// <summary>
        /// The psz_object_type
        /// </summary>
        public IntPtr psz_object_type;
        /// <summary>
        /// The psz_object_name
        /// </summary>
        public IntPtr psz_object_name;
        /// <summary>
        /// The psz_header
        /// </summary>
        public IntPtr psz_header;
        /// <summary>
        /// The i_flags
        /// </summary>
        public Int32 i_flags;
        /// <summary>
        /// The b_error
        /// </summary>
        public bool b_error;
        /// <summary>
        /// The b_die
        /// </summary>
        public bool b_die;
        /// <summary>
        /// The b_force
        /// </summary>
        public bool b_force;
        /// <summary>
        /// The be_sure_to_add_ VL c_ COMMO n_ MEMBER s_to_struct
        /// </summary>
        public bool be_sure_to_add_VLC_COMMON_MEMBERS_to_struct;
        /// <summary>
        /// The p_libvlc
        /// </summary>
        public IntPtr p_libvlc;
        /// <summary>
        /// The p_parent
        /// </summary>
        public IntPtr p_parent;
        /// <summary>
        /// The p_private
        /// </summary>
        public IntPtr p_private;

        /// <summary>
        /// Gets the name of the object.
        /// </summary>
        /// <value>The name of the object.</value>
        public string ObjectName
        {
            get
            {
                return Marshal.PtrToStringAnsi(psz_object_name);
            }
        }

        /// <summary>
        /// Gets the type of the object.
        /// </summary>
        /// <value>The type of the object.</value>
        public string ObjectType
        {
            get
            {
                return Marshal.PtrToStringAnsi(psz_object_type);
            }
        }

        /// <summary>
        /// Gets the header.
        /// </summary>
        /// <value>The header.</value>
        public string Header
        {
            get
            {
                return Marshal.PtrToStringAnsi(psz_header);
            }
        }

        /// <summary>
        /// Returns a <see cref="System.String" /> that represents this instance.
        /// </summary>
        /// <returns>A <see cref="System.String" /> that represents this instance.</returns>
        public override string ToString()
        {
            return String.Format("Name='{0}' Type='{1}' ", ObjectName, ObjectType);
        }
    }
}
